package com.demo.linknode;

import java.io.IOException;

public class TestLinkNode {
    public static void main(String[] args) throws IOException {
        Node t = new Node(12);

        Node f = t;
        System.out.println("d1:"+f.getData());
        t.setData(3);

        System.out.println("d2:"+f.getData());




        Node head = new Node(0);
        Node node1 = new Node(1);
        Node node2 = new Node(2);
        Node node3 = new Node(3);
        head.setNext(node1);
        node1.setNext(node2);
        node2.setNext(node3);

        // 打印反转前的链表
        Node h = head;
        while (null != h) {
            System.out.print(h.getData() + " ");
            h = h.getNext();
        }
        // 调用反转方法
        head = Reverse1(head);

        System.out.println("\n**************************");
        // 打印反转后的结果
        while (null != head) {
            System.out.print(head.getData() + " ");
            head = head.getNext();
        }

    }

    //顺序反转，pre,cur,temp
    private static Node Reverse1(Node node){
        return null;
     }

}
